<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>部门</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="/css/public.css" media="all"/>
    <link rel="stylesheet" href="/layui_ext/dtree/dtree.css" media="all"/>
    <link rel="stylesheet" href="/layui_ext/dtree/font/dtreefont.css" media="all"/>
</head>
<body class="father_body">
<!--    树-->
    <div>
        <ul id="permissionTree" class="dtree" data-id="0"></ul>
    </div>

</body>
<script type="text/javascript" src="/layui/layui.js"></script>
<script type="text/javascript">
    var  leftPermissionTree;
    layui.extend({
        dtree: '/resources/layui_ext/dtree/dtree'   // {/}的意思即代表采用自有路径，即不跟随 base 路径
    }).use(['dtree','layer','jquery'], function(){

        var dtree = layui.dtree;
        var layer = layui.layer;
        var $=layui.jquery;

        leftPermissionTree=dtree.render({
            elem: "#permissionTree",
            url: "/menu/loadAllMenuTreeJson",
            dataStyle: "layuiStyle",  //使用layui风格的数据格式
            dataFormat: "list",  //配置data的风格为list
            response:{message:"msg",statusCode:0},  //修改response中返回数据的定义
        });
        dtree.on("node('permissionTree')", function(obj){
            // layer.msg(JSON.stringify(obj.param.nodeId));
            window.parent.main.reloadTable(obj.param.nodeId);
        });
    });

</script>

</html>